﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    /// <summary>
    /// 调拨单主表实体类，对应数据库表 dbo.wh_transfer
    /// </summary>
    public class WhTransfer
    {
        /// <summary>
        /// 调拨单ID（主键）
        /// </summary>
        [Key]
        public long TransferOrderId { get; set; }

        /// <summary>
        /// 调拨单号
        /// </summary>
        public string TransferOrderNo { get; set; }

        /// <summary>
        /// 调拨类型
        /// </summary>
        public string TransferType { get; set; }

        /// <summary>
        /// 调拨申请日期
        /// </summary>
        public DateTime TransferApplyDate { get; set; }

        /// <summary>
        /// 调出仓库ID
        /// </summary>
        public int TransferOutWarehouseId { get; set; }

        /// <summary>
        /// 调入仓库ID
        /// </summary>
        public int TransferWarehouseId { get; set; }

        /// <summary>
        /// 操作人员
        /// </summary>
        public long OperatorBy { get; set; }

        /// <summary>
        /// 操作日期
        /// </summary>
        public DateTime OperatorDate { get; set; }

        /// <summary>
        /// 入库标识
        /// </summary>
        public string Inbound { get; set; }

        /// <summary>
        /// 出库标识
        /// </summary>
        public string Outbound { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        public string OrderStatus { get; set; }

        /// <summary>
        /// 审核人
        /// </summary>
        public long AuditorBy { get; set; }

        /// <summary>
        /// 审核时间
        /// </summary>
        public DateTime AuditorTime { get; set; }

        /// <summary>
        /// 审核备注
        /// </summary>
        public string AuditorComment { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public long CreateBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 更新人
        /// </summary>
        public long UpdateBy { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }
    }

    /// <summary>
    /// 查询调拨明细实体
    /// </summary>
    public class WhTransferForAddWhTDetail
    {
        //商品ID
        public long GoodsId { get; set; }
        //商品编号
        public string GoodsCode { get; set; }
        //商品名称
        public string GoodsName { get; set; }
        //规格型号
        public string Specification {  get; set; }
        //货品类型
        public string GoodsTypeName { get; set; }
        //入库单价(加权平均法得来)
        public decimal PurchaseReferencePrice { get; set; }
        //调拨出库库存
        public decimal OutStock {  get; set; }
        //调拨入库库存
        public decimal InStock { get; set; }
    }

    /// <summary>
    /// 添加调拨单时传入的主表实体
    /// </summary>
    public class WhTransferModelWithMain
    {
        //调拨单编号
        public string TransferOrderNo { get; set; }
        //调拨类型
        public string TransferType { get; set; }
        //调拨申请日期
        public DateTime TransferApplyDate { get; set; }
        //调出仓库ID
        public long TransferOutWarehouseId { get; set; }
        //调入仓库ID
        public long TransferWarehouseId { get; set; }
        //操作人/经办人
        public long OperatorBy { get; set; }
        //创建人
        public long CreateBy { get; set; }
        //更新人
        public long UpdateBy { get; set; }
    }

    /// <summary>
    /// 调拨单明细实体类
    /// </summary>
    public class WhTransferModelWithDetail
    {
        //调拨单ID
        public long TransferOrderId { get; set; }
        //货品编号
        public string GoodsCode { get; set; }
        //货品类型Id
        public long GoodsTypeId { get; set; }
        //单位
        public string ProductUnit { get; set; }
        //调拨数量
        public decimal TransferQuantity { get; set; }
        //调拨单价
        public decimal TransferUnitPrice { get; set; }
        //调出仓库位
        public long FromLocation { get; set; }
        //调入仓库位
        public long ToLocation { get; set; }
        //调入数量
        public decimal InboundNum { get; set; }
        //调出数量
        public decimal OutboundNum { get; set; }
        //创建人
        public long CreateBy { get; set; }
        //更新人
        public long UpdateBy { get; set; }
        //附件ID
        public string AttachmentCode { get; set; }
        //备注
        public string Remarks { get; set; }
    }

    public class SelectLocationGetQuantity
    {
        //库位ID
        public long InventoryId { get; set; }
        //仓库Id
        public long WarehouseId { get; set; }
        //商品ID
        public long GoodsId { get; set; }
        //可用库存数量
        public decimal AvailableInventoryQty { get; set; }
    }

    /// <summary>
    /// 显示所有调拨单实体
    /// </summary>
    public class GetAllWhTransfer
    {
        public long TransferOrderId { get; set; }
        public string TransferOrderNo { get; set; }
        public string OrderStatus { get; set; }
        public DateTime OperatorDate { get; set; }
        public string TransferType { get; set; }
        public string TransferOutWarehouse { get; set; }
        public string TransferInWarehouse{ get;set; }
        public string Inbound { get; set; }
        public string Outbound { get; set; }
        public decimal AllTransferQuantity { get; set; }
        public decimal AllTransferAmount { get; set; }
        public string OperatorBy { get; set; }
        public string AllGoodsName { get; set; }
        public string CreateBy { get; set; }
        public string OrgName { get; set; }
        public DateTime CreateTime { get; set; }
        public string AuditorBy { get; set; }
        public DateTime AuditorTime { get; set; }
    }

    public class AuditerModel
    {
        //审核单据Id
        public List<long> IdList { get; set; }
        //审核人
        public long AuditorId { get; set; }
        //审核结果
        public string AuditorStatu {  get; set; }
        //审核意见
        public string AuditeComment { get; set; }
    }

    //调拨单多条件查询实体
    public class SelectWhTransferWithSthModel
    {
        public string orderNo { get; set; }
        public string OrderStatus { get; set; }
        public string InboundOrOutBound { get; set; }
        public DateTime StartTime {  get; set; }
        public DateTime EndTime { get; set; }
    }
}
